# This code has the Device Class to keep information about one device in home.
# It creates a profile of devices inside the home.

import time
import sys
import device_stat as ds
import util
import datetime

class Device:
    def __init__(self,mac):
        print "Creating Device Object for Device:" , mac
        self.device_id = mac  # MAC Address of the device to be used as device ID
        self.dev_name = ""
        self.device_type = None # is it a mobile or fixed device?
        self.dev_loc = None
        now = datetime.datetime.now()
        self.dev_stat = ds.DeviceStat(self.device_id,now)
        print time.time()
        pass
    pass
    
    def getDeviceName(self):
        return self.dev_name

    def getDeviceID(self):
        return self.device_id

    def getDeviceType(self):
        return self.device_type

    def setDeviceType(self,dev_type):
        self.device_type = dev_type
    # -- 
    # Estimated location of device.
    # This calue is fixed for fixed devices and variable for variable devices.
    # --
    def setDeviceLoc(self,dev_loc):
        self.dev_loc = dev_loc

    def setDeviceName(self,dev_name):
        self.dev_name = dev_name
    
    # --
    # This function is used to print the device stat information
    # and the device information.
    # -- 
    def printDevInfo(self):
        print "Device ID: ", self.device_id
        print "Device Name: ",  self.dev_name
        print "Device Type: ", self.device_type
        print "Device Location: ", self.dev_loc
        self.dev_stat.printDevStat()
